#include<iostream>
#include<string>
#include<memory>

#include"TcpServer.hpp"
#include"Log.hpp"
using std::cout;
using std::endl;

void Usage(const char*arg)
{
    cout<<"USAGE:"<<endl;
    cout<<"#         please enter: "<<arg<<"serverport"<<endl;
}


// ./server 8888
int main(int argc,char*argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    Enablescreen();
    uint16_t port=std::stoi(argv[1]);
    std::unique_ptr<TcpServer> tsp=std::make_unique<TcpServer>(port);
    tsp->InitServer();
    tsp->StartServer();




    return 0;
}